

#include <gtk/gtk.h>

#include "window.h"
#include "toolbar.h"
#include "keypad.h"
#include "memview.h"
#include "ioview.h"
#include "fileops.h"
#include "memfill.h"
#include "help.h"

/*#################### Initilise application's toolbar #################*/
GtkWidget *gsim_get_toolbar( void )
{
	GtkWidget *toolbar ;
	
	toolbar = gtk_toolbar_new( );
	
	/*insert toolbar items */
	//gtk_toolbar_append_space( GTK_TOOLBAR (toolbar) );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_NEW ,"New File",NULL,gsim_new_file,NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_OPEN ,"Open File",NULL,gsim_open_file,NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_SAVE ,"Save File",NULL,gsim_save_file,NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_SAVE_AS ,"Save  As",NULL,gsim_save_as_file,NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_CLOSE ,"Close File",NULL,gsim_close_file,NULL,-1 );
	//gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_PRINT ,"Print File",NULL,gsim_print_file,NULL,-1 );
	//gtk_toolbar_append_space( GTK_TOOLBAR (toolbar) );
	//gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_UNDO,"Undo",NULL,NULL,NULL,-1 );
	//gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_REDO ,"Redo",NULL,NULL,NULL,-1 );
	gtk_toolbar_append_space( GTK_TOOLBAR (toolbar) );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_REFRESH ,"Update Memory",NULL,gsim_update_memory,NULL,-1 );
	gtk_toolbar_append_space( GTK_TOOLBAR (toolbar) );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GSIM_STOCK_KEYPAD ,"Show/Hide Keypad",NULL,G_CALLBACK(show_hide_keypad),NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GSIM_STOCK_MEMORY ,"Show/Hide Memory Window",NULL,show_hide_memview,NULL,-1 );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GSIM_STOCK_PORT ,"Show/Hide Port Window",NULL,show_hide_ioview,NULL,-1 );
	gtk_toolbar_append_space( GTK_TOOLBAR (toolbar) );
	gtk_toolbar_insert_stock( GTK_TOOLBAR( toolbar ) , GTK_STOCK_HELP ,"Help",NULL,gsim_contents,NULL,-1 );
	
	gtk_toolbar_set_style(GTK_TOOLBAR( toolbar ) , GTK_TOOLBAR_ICONS);
	
	return toolbar;
}
